package com.mnc.entity;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
@Entity
public class UserType implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 2675463797267266229L;
	
	//主键id
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int typeId;
	//类型名称
	@Column
	private String typeName;
	//类型简介
	@Column
	private String typeDesc;
	//针对后台用户类型分配的操作,以;隔开的字符串
	@Column
	private String typeActions;
	//对应用户
	@OneToMany(mappedBy="myType",cascade={CascadeType.REFRESH},fetch=FetchType.EAGER)
	private Set<User> users=new HashSet<User>();
	public int getTypeId() {
		return typeId;
	}
	public void setTypeId(int typeId) {
		this.typeId = typeId;
	}
	public String getTypeName() {
		return typeName;
	}
	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}
	public String getTypeDesc() {
		return typeDesc;
	}
	public void setTypeDesc(String typeDesc) {
		this.typeDesc = typeDesc;
	}
	public Set<User> getUsers() {
		return users;
	}
	public void setUsers(Set<User> users) {
		this.users = users;
	}
	public String getTypeActions() {
		return typeActions;
	}
	public void setTypeActions(String typeActions) {
		this.typeActions = typeActions;
	}
	
	
	
}
